package com.huatai.bi.websocket;


import com.alibaba.fastjson.JSONObject;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

/**
 * @program: ganghua
 * @description: 编码器
 * @author: songxiude
 * @create: 2024-09-19 09:36
 **/
public class EncoderServer implements Encoder.Text<MessageResult> {
	@Override
	public String encode(MessageResult messageResult) throws EncodeException {
		String jsonString = JSONObject.toJSONString(messageResult);
		return jsonString;
	}

	@Override
	public void init(EndpointConfig endpointConfig) {

	}

	@Override
	public void destroy() {

	}
}
